<%--
  Created by IntelliJ IDEA.
  User: aiju
  Date: 2022/8/24
  Time: 19:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<head>
    <title>servlet测试</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
</head>

<body>
<div class="container-fluid">
<div class="shadow p-2 mb-4 bg-red rounded">
<h1><%= "java-servlet测试" %></h1>
</div>
<div class="shadow p-1 mb-2 bg-white rounded">
<h1><% Object value = request.getAttribute("name");
out.println(value);
%></h1>
</div>
<div class="shadow p-1 mb-2 bg-white rounded">
<h1>
    ${requestScope.name}
</h1>
</div>
<div class="shadow p-1 mb-2 bg-white rounded">
<h1>
    id:${requestScope.user.id}
</h1>
    </div>
<div class="shadow p-1 mb-2 bg-white rounded">
<h1>
    姓名:${requestScope.user.name}
</h1>
</div>
<div class="shadow p-1 mb-2 bg-white rounded">
    <table>
        <c:forEach items="${requestScope.userList}" var="user">
        <tr>
            <td>id:${user.id}</td>
            <td>name:${user.name}</td>
        </tr>
        </c:forEach>

    </table>
</div>
<br/>
<div class="shadow p-1 mb-2 bg-white rounded">
<form action="/wzby/java-servlet" method="post">
<input type="text" name="id" placeholder="请输入id"/>
<input type="text" name="name" placeholder="请输入name"/>
<input type="submit" value="提交" />
</form>
</div>
</div>
</body>
</html>
